package com.ghsc.ghxc.jsb.ui.live.view.video.viewHolder

import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.ghsc.ghxc.jsb.databinding.ItemVideoPlayAdBinding
import com.ghsc.ghxc.jsb.ui.live.bean.VideoDataBean


//如果需要插入广告，就是这个广告的item
class VideoAdHolder(private val itemBinding: ItemVideoPlayAdBinding) :
    RecyclerView.ViewHolder(itemBinding.root) {

    fun onBind(position: Int, data: VideoDataBean) {
        val adView = data.adView
        itemBinding.adLayout.removeAllViews()
        (adView?.parent as? ViewGroup)?.removeAllViews()
        itemBinding.adLayout.addView(adView)

    }
}